<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<style type="text/css">
	.contain{
		width:400px;
		margin:100px auto;
	}
</style>
</head>
<body>
	<div class = "contain">
		<div><h1>你还没有登陆，请登录！</h1></div>
		<div id="div1"></div>
	</div>


	<script type="text/javascript">  
		var t = 5;
		function showTime() {
			t -= 1;
			document.getElementById('div1').innerHTML = t+"秒进入登录页面...";
			if (t == 0) {
				location.href = '/index';
			}
			//每秒执行一次,showTime()  
			setTimeout("showTime()", 1000);
		}

		//执行showTime()  
		showTime();
	</script>
</body>
</html>